<script setup>
import { ref } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { useStore } from 'vuex';

const router = useRouter();
const store = useStore();

// 用户管理列表
store.dispatch('home/updateCinemaList');
const cinemaList = computed(() => store.state.home.cinemaList);


// 表格
const handleClick = () => {
  console.log('click');
};


// 导出excel


</script>

<template>
  <div class="table-wrapper">
    <div class="header">
      <div class="inp">
        <el-input v-model="input" placeholder="请输入内容" />
        <div class="btn">搜索</div>
      </div>
      <el-button type="primary">添加影院</el-button>
      <el-button type="primary">切换主题</el-button>
    </div>
    <div class="content">
      <el-table
        :data="cinemaList"
        :border="true"
        style="width: 100%"
      >
        <el-table-column prop="cinema_id" label="影院ID" width="80" align="center" />
        <el-table-column prop="cinema_name" label="影院名" width="200" align="center" />
        <el-table-column prop="cinema_phone" label="联系电话" width="180" align="center" />
        <el-table-column prop="specified_address" label="详细地址" width="300" align="center" />
        <el-table-column fixed="right" label="操作" width="180" align="center">
          <template #default>
            <el-button :bg="true" size="small" @click="goToEdit">编辑</el-button>
            <el-button :bg="true" type="danger" size="small" @click="onDelete">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div class="footer">
      <el-button
        type="primary"
      >
        导出excel
      </el-button>
      <el-pagination layout="prev, pager, next" :total="1000" />
    </div>
  </div>
</template>

<style scoped lang="scss">
.table-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  .header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 0;
    margin-bottom: 30px;
    height: 40px;

    .inp {
      margin-right: 20px;
      width: 500px;
      height: 40px;
      .el-input {
        background-color: #FFF;
        background-image: none;
        border-radius: 4px;
        color: #606266;
        font-size: inherit;
        height: 100%;
        line-height: 40px;
        width: 410px;
      }
      .btn {
        display: inline-block;
        line-height: 1;
        white-space: nowrap;
        cursor: pointer;
        background: #f5f7fa;
        border: 1px solid #DCDFE6;
        color: #606266;
        text-align: center;
        box-sizing: border-box;
        margin: 0;
        transition: .1s;
        font-weight: 500;
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 0 4px 4px 0;
      }
    }
    .el-button {
      margin-right: 20px;
      font-size: 12px;
      border-radius: 3px;
    }
  }
  .content {
    width: 900px;
    margin-bottom: 20px;
    .el-table {
      width: 100%;
      border: 1px solid #ebeef5;

    }
  }
  .footer {
    width: 900px;
    height: 40px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .demo-pagination-block {
      display: flex;
      justify-content: right;
      align-items: center;

    }
  }
}
</style>
